package crmdna.client.sequence;
import java.util.List;

import crmdna.common.APIException;
import crmdna.common.APIResponse.Status;
import crmdna.crmdna.Client;

public class Sequence {
	public enum SequenceType {
		MEMBER, VENUE, TEACHER, PRACTICE, GROUP, USER, INTERACTION, PROGRAM_TYPE, PROGRAM, PARTICIPANT
	}			

	public static long getNext(final String client, SequenceType sequenceType) {
		List<Long> list = getNext(client, sequenceType, 1);
		return list.get(0);
	}
	
	public static List<Long> getNext(final String client, final SequenceType type, final int numElements) {
		
		Client.ensureValidClient(client);
		
		if (type == null)
				throw new APIException(Status.ERROR_RESOURCE_INCORRECTLY_SPECIFIED, 
						"type cannot be null when calling getNext in Sequence");
		
		return SequenceCore.getNext(client, type.toString(), numElements);						
	}
}